<extend file='resource/admin/base'/>
<block name="content">
    <!-- TAB NAVIGATION -->
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="{{u(index)}}" >文章管理</a></li>
        <li><a href="{{u(post)}}">{{$oldData['art_id']?'文章编辑':'文章添加'}}</a></li>
    
    </ul>
    <!-- TAB CONTENT -->
    <table class="table table-hover">
        <thead>
        <tr>
            <th>编号</th>
            <th>文章名称</th>
            <th>操作</th>
        </tr>
        </thead>
        
        <tbody>
        <foreach from="$field" value="$d" >
            <tr>
                <td>{{$d['art_id']}}</td>
                <td>{{$d['art_title']}}</td>
                <td>
                    <div class="btn-group btn-group-sm">
                        <a href="{{u(post,['art_id'=>$d['art_id']])}}" type="button" class="btn btn-info">编辑</a>
                        <a href="javascript:;" onclick="del({{$d['art_id']}})" type="button" class="btn btn-danger">删除</a>
                    </div>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    {{$field->links()}}
    <script>
         
         function del(art_id){
             util.confirm('确定删除吗?',function(res){
                 location.href = "{{u('del')}}&art_id=" + art_id;
             })
         }
    
    </script>
    

</block>